package com.douqu.game.core.config.talent;

import com.douqu.game.core.config.common.CommonData;
import com.douqu.game.core.config.common.GoodsData;
import com.douqu.game.core.e.E_ValueType;
import com.douqu.game.core.entity.GameObject;
import com.douqu.game.core.factory.DataFactory;
import com.douqu.game.core.util.LoadUtils;
import com.douqu.game.core.util.LogUtils;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2018-10-11 10:44
 */
public class TalentConfig extends GameObject {

    //天赋属性类型
    //1.攻击天赋
    //2.防御天赋
    //3.策略天赋
    public int type;

    /**
     * 精炼条件
     */
    public int[] camp;

    public int[] army;

    public int master;


    @Override
    public boolean check() {

        if(camp == null)
        {
            LogUtils.error("Load Talent check camp error -> id:" + id);
            return false;
        }
        if(army == null)
        {
            LogUtils.error("Load Talent check army error -> id:" + id);
            return false;
        }

        return super.check();
    }


    @Override
    public boolean setVariable(String key, String value)
    {

         if("camp".equals(key))
        {
            camp = LoadUtils.loadIntArray(key, value);
            return true;
        }
        else if("army".equals(key))
        {
            army =  LoadUtils.loadIntArray(key, value);
            return true;
        }
        else
            return super.setVariable(key, value);
    }
}
